package com.goldplusgold.support.lib.manager.time;

import java.util.Date;

/**
 * Created by Administrator on 2017/7/18.
 */

public class TimeBean {

    public static final int DELAY = 0 ; //延迟多少毫秒执行一次的模式

    public static final int APPOINT = 1 ; //指定到什么时间执行一次的模式

    public static final int LOOP_DELAY = 2 ; // 延迟多少毫秒后循环执行的模式

    public static final int LOOP_APPOINT = 3 ;// 延迟多少毫秒后循环执行的模式

    private int state ;//模式

    private long delaytime;//延迟多少时间

    private Date delaydate ; //指定在什么时间

    private long period ;//多少秒一循环

    private TimerInterface timerInterface;//做事的接口

    public TimeBean(long delaytime, TimerInterface timerInterface) {

        this.state = DELAY ;
        this.delaytime = delaytime;
        this.timerInterface = timerInterface;

    }


    public TimeBean(Date delaydate , TimerInterface timerInterface){
        this.state = APPOINT ;
        this.delaydate = delaydate;
        this.timerInterface = timerInterface;

    }

    public TimeBean(long delaytime, long period , TimerInterface timerInterface){

        this.state = LOOP_DELAY ;
        this.delaytime = delaytime;
        this.period = period ;
        this.timerInterface = timerInterface;

    }

    public TimeBean(Date delaydate, long period , TimerInterface timerInterface){

        this.state = LOOP_APPOINT ;
        this.delaydate = delaydate;
        this.period = period ;
        this.timerInterface = timerInterface;

    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public long getDelaytime() {
        return delaytime;
    }

    public void setDelaytime(long delaytime) {
        this.delaytime = delaytime;
    }

    public Date getDelaydate() {
        return delaydate;
    }

    public void setDelaydate(Date delaydate) {
        this.delaydate = delaydate;
    }

    public long getPeriod() {
        return period;
    }

    public void setPeriod(long period) {
        this.period = period;
    }

    public TimerInterface getTimerInterface() {
        return timerInterface;
    }

    public void setTimerInterface(TimerInterface timerInterface) {
        this.timerInterface = timerInterface;
    }

}
